import type { MockMethod } from 'vite-plugin-mock';

const mockData: MockMethod[] = [
    {
        url: '/Login/index',
        method: 'post',
        timeout: 1500,
        response: () => {
            return {
                code: 1,
                msg: '登录成功',
                data: {
                    id: 1,
                    username: 'root',
                    nickname: 'root',
                    password: '2b3e45f908e9fcd2809a74840a4b42cf',
                    create_time: '2021-10-15 17:52:29',
                    create_ip: 2130706433,
                    update_time: '2021-10-18 18:09:15',
                    status: 1,
                    openid: null,
                    access: ['admin/Login/index'],
                    menu: [
                        {
                            id: 1,
                            title: '首页',
                            fid: 23,
                            url: '',
                            auth: 1,
                            sort: 0,
                            show: 1,
                            icon: 'md-list-box',
                            level: 2,
                            component: 'app/list',
                            router: '/home',
                            log: 1,
                            permission: 1,
                            method: 1,
                        },
                        {
                            id: 2,
                            title: '系统管理',
                            fid: 23,
                            url: 'system',
                            auth: 1,
                            sort: 0,
                            show: 1,
                            icon: 'md-list-box',
                            level: 2,
                            component: 'app/list',
                            router: 'appsList',
                            log: 1,
                            permission: 1,
                            method: 1,
                            children: [
                                {
                                    id: 21,
                                    title: '菜单维护',
                                    fid: 23,
                                    auth: 1,
                                    sort: 0,
                                    show: 1,
                                    icon: 'md-list-box',
                                    level: 2,
                                    component: '/view/system/menu/index',
                                    router: '/system/menu',
                                    log: 1,
                                    permission: 1,
                                    method: 1,
                                },
                                {
                                    id: 22,
                                    title: '用户管理',
                                    fid: 23,
                                    auth: 1,
                                    sort: 0,
                                    show: 1,
                                    icon: 'md-list-box',
                                    level: 2,
                                    component: '/view/system/user/index',
                                    router: '/system/user',
                                    log: 1,
                                    permission: 1,
                                    method: 1,
                                },
                                {
                                    id: 23,
                                    title: '权限管理',
                                    fid: 23,
                                    url: 'permission',
                                    auth: 1,
                                    sort: 0,
                                    show: 1,
                                    icon: 'md-list-box',
                                    level: 2,
                                    component: '/view/system/auth/index',
                                    router: '/system/permission',
                                    log: 1,
                                    permission: 1,
                                    method: 1,
                                },
                                {
                                    id: 24,
                                    title: '日志管理',
                                    fid: 23,
                                    url: 'log',
                                    auth: 1,
                                    sort: 0,
                                    show: 1,
                                    icon: 'md-list-box',
                                    level: 2,
                                    component: '/view/system/log/index',
                                    router: '/system/log',
                                    log: 1,
                                    permission: 1,
                                    method: 1,
                                },
                            ],
                        },
                    ],
                    apiAuth: 'e47c332d258ddb4c802f0f25acba96eb',
                    userData: {
                        id: 1,
                        login_times: 10,
                        last_login_ip: '827180120',
                        last_login_time: 1634799776,
                        uid: 1,
                        head_img: '',
                    },
                },
            };
        },
    },
    {
        url: '/Login/getUserInfo',
        method: 'get',
        response: () => {
            return {
                code: 1,
                msg: '登录成功',
                data: {
                    id: 1,
                    username: 'root',
                    nickname: 'root',
                    password: '2b3e45f908e9fcd2809a74840a4b42cf',
                    create_time: '2021-10-15 17:52:29',
                    create_ip: 2130706433,
                    update_time: '2021-10-18 18:09:15',
                    status: 1,
                    openid: null,
                    access: ['admin/Login/index'],
                    menu: [
                        {
                            id: 1,
                            title: '首页',
                            fid: 23,
                            url: '',
                            auth: 1,
                            sort: 0,
                            show: 1,
                            icon: 'md-list-box',
                            level: 2,
                            component: 'app/list',
                            router: '/home',
                            log: 1,
                            permission: 1,
                            method: 1,
                        },
                        {
                            id: 2,
                            title: '系统管理',
                            fid: 23,
                            url: 'system',
                            auth: 1,
                            sort: 0,
                            show: 1,
                            icon: 'md-list-box',
                            level: 2,
                            component: 'app/list',
                            router: 'appsList',
                            log: 1,
                            permission: 1,
                            method: 1,
                            children: [
                                {
                                    id: 21,
                                    title: '菜单维护',
                                    fid: 23,
                                    auth: 1,
                                    sort: 0,
                                    show: 1,
                                    icon: 'md-list-box',
                                    level: 2,
                                    component: '/view/system/menu/index',
                                    router: '/system/menu',
                                    log: 1,
                                    permission: 1,
                                    method: 1,
                                },
                                {
                                    id: 22,
                                    title: '用户管理',
                                    fid: 23,
                                    auth: 1,
                                    sort: 0,
                                    show: 1,
                                    icon: 'md-list-box',
                                    level: 2,
                                    component: '/view/system/user/index',
                                    router: '/system/user',
                                    log: 1,
                                    permission: 1,
                                    method: 1,
                                },
                                {
                                    id: 23,
                                    title: '权限管理',
                                    fid: 23,
                                    url: 'permission',
                                    auth: 1,
                                    sort: 0,
                                    show: 1,
                                    icon: 'md-list-box',
                                    level: 2,
                                    component: '/view/system/auth/index',
                                    router: '/system/permission',
                                    log: 1,
                                    permission: 1,
                                    method: 1,
                                },
                                {
                                    id: 24,
                                    title: '日志管理',
                                    fid: 23,
                                    url: 'log',
                                    auth: 1,
                                    sort: 0,
                                    show: 1,
                                    icon: 'md-list-box',
                                    level: 2,
                                    component: '/view/system/log/index',
                                    router: '/system/log',
                                    log: 1,
                                    permission: 1,
                                    method: 1,
                                },
                            ],
                        },
                    ],
                    apiAuth: 'e47c332d258ddb4c802f0f25acba96eb',
                    userData: {
                        id: 1,
                        login_times: 10,
                        last_login_ip: '827180120',
                        last_login_time: 1634799776,
                        uid: 1,
                        head_img: '',
                    },
                },
            };
        },
    }
];

export default mockData;
